#include "import_matrix.hpp"
#include <iostream>
#include <vector>
#include <string>
#include <fstream>

using namespace std;

float * import(string name, int rows, int columns) {
	
	int MATRIX_ROWS = rows;
	int MATRIX_COLS = columns;

	float * matrix = new float[rows * columns];

	ifstream ifs(name);
	if(ifs.is_open()) {
		cout << "File " << name << " opened." << endl;
	} else {
		cout << "Could not open file " << name << endl;
		return matrix;
	}

	float readFloat;

	int curPos = 0;
	
	while(ifs >> readFloat) {
		matrix[curPos] = readFloat;
		curPos++;
	}

	return matrix;
}